<?php

include "header.php";
require_once("phpbb.class.php");

$phpbb_action = @$_REQUEST["op"];
//***************************************************************
//parameters used at class construction
//first parameter = absoulute physical path of the phpbb 3 forum ($phpbb_root_path variable)
//second parameter = php scripts extensions ($phpEx variable)
$phpbb = new phpbb("forum", "php");

$P = new cMyPage;
if($P->isLoggedIn() ) {

$id = addslashes($_GET['id']);
$query = "SELECT * FROM resumes WHERE id = '$id' ORDER BY rid DESC LIMIT 1";
$execQuery = $db->sql_query($query);
$row = $db->sql_fetchrow($execQuery);
	if( $db->sql_affectedrows() > 0 ) {
		header('Content-Type: '.$row['type']);
		header("Content-Disposition: attachment; filename=\"$row[name]\"");
  
		print $row['content'];
	}
}

?>